{include file="base/publicView"}
<style type="text/css">
	#upload{
		opacity:0;
	}
	#img{
		display:block;
		border:1px solid #666;
		height:92px;
		width:92px;
		cursor:pointer;
		margin-top: -29px;
		margin-left: -17px;
	}
</style>
<section class="rt_wrap content mCustomScrollbar">
 <div class="rt_content">
      <div class="page_title">
       <h2 class="fl">产品详情</h2>
       <a href="{:url('/admin/product/productlist')}" class="fr top_rt_btn ">产品列表</a>
      </div>
	  <form action="{:url('/admin/product/productadd')}" method="post" enctype="multipart/form-data">
		  <ul class="ulColumn2">
			   <li>
					<span class="item_name" style="width:120px;">产品标题：</span>
					<input type="text" class="textbox textbox_225" value="" placeholder="产品标题..." name="pro_title"/>
			   </li>
			   <li>
					<span class="item_name" style="width:120px;">产品描述内容：</span>
					<input type="text" class="textbox textbox_225" value="" placeholder="产品标题..." name="pro_des"/>
			   </li>
			   <li>
					<span class="item_name" style="width:120px;">产品价格：</span>
					<input type="text" class="textbox textbox_225" value="" placeholder="产品价格（单位：元)" name="pro_price"/>
					<span>元</span>
			   </li>
			   <li>
					<span class="item_name" style="width:120px;">是否为新品：</span>
					<select class="select" name="pro_isnew">
							<option value ="">是否为新品</option>
							<option value="1">是</option>
							<option value="0">否</option>
					</select>
			   </li>
			   <li>
				<span class="item_name" style="width:120px;">上传头像：</span>
					<label class="uploadImg" for="upload">
						 <input type="file" name="pro_pic" id="upload"/>
						 <span>上传头像</span>
						 <img src="/static/admin/images/upload.jpg" alt="" id="img"/>
					</label>
			   </li>
			   <li>
					<span class="item_name" style="width:120px;"></span>
					<input type="submit" class="link_btn" value="更新/保存"/>
			   </li>
		  </ul>
	</form>
 </div>
</section>
</body>
<script type="text/javascript">
	function getObjectURL(file) {
	  var url = null ; 
	  if (window.createObjectURL!=undefined) { // basic
		url = window.createObjectURL(file) ;
	  } else if (window.URL!=undefined) { // mozilla(firefox)
		url = window.URL.createObjectURL(file) ;
	  } else if (window.webkitURL!=undefined) { // webkit or chrome
		url = window.webkitURL.createObjectURL(file) ;
	  }
	  return url ;
	}
	$('#upload').change(function(){
		var url=getObjectURL(this.files[0]);
		if(url){
			$('#img').attr('src',url);
		}
	})
</script>
</html>
<!--
本代码由js代码网网友上传，js代码网收集并编辑整理;
尊重他人劳动成果;
转载请保留js代码链接 - www.jsdaima.com
-->